/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.team1160.breakaway.util;

import edu.wpi.first.wpilibj.Solenoid;

/**
 *
 * @author CJ
 */
public class Piston {

    protected Solenoid front_id, back_id;;

    public Piston(int front_id, int back_id){
        this.front_id = new Solenoid(front_id);
        this.back_id = new Solenoid(back_id);
    }

    public void fire(){
        this.front_id.set(false);
        this.back_id.set(true);
    }

    public void retract(){
        this.front_id.set(true);
        this.back_id.set(false);
    }

    public boolean isExtended(){
        return !this.front_id.get() && this.back_id.get();
    }

    public boolean isRetracted(){
        return !this.isExtended();
    }

}
